package com.findMoneyGame.pages {
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.events.Event;

	import com.findMoneyGame.models.Model;
	import com.findMoneyGame.models.User;

	public class Wrapper extends MovieClip {
		public static const SHOW_GAMELEVEL : String = "showGameLevel";
		public static const SHOW_PURCHASINGS_PAGE : String = "showPurchasingsPage";
		public static const SHOW_BUY_MONEY_PAGE : String = "showBuyMoneyPage";
		public static const SHOW_ACHIEVEMENTS_PAGE : String = "showAchievementsPage";
		public static const SHOW_HELP_PAGE : String = "showHelpPage";

		private function get user () { return User.getInst(); }

		public function Wrapper () {
			user.addEventListener(Model.UPDATE, function (e : Event) { refresh(); });
			refresh();
		}

		private function refresh () {
			levelIndicator.level = user.level;
			buyMoneyPageButton.money = user.moneyCount;
		}
	}
}